import request from '@/utils/http'; // 导入http中创建的axios实例
import qs from "qs"
const adminStore = {
	//添加店铺
	addAdminStore(params){
		return request({
			url: '/shop/add',
			method: 'post',
			data:params
		})
	},
	//获取B端商铺列表
	adminStoreList(){
		return request({
			url: '/shop/list',
			method: 'get'
		})
	},
	//获取C端商铺列表
	adminCStoreList(params){
		// 这是参数,agentStatus=2是团购代收点, lat_lng是用户的经纬度,用于获取距离km
		// params.agentStatus = 2
		// params.params = {}
		// params.params.lat = 40.8150800
		// params.params.lng = 114.9137900
		
		let post_param = qs.stringify(params,{indices: false })
		return request({
			url: '/shop/list?' + post_param,
			method: 'get'
		})
	},
	//删除店铺
	delStore(id){
		return request({
			url:'/shop/del/' + id,
			method:'delete'
		})
	},
	//停业
	closeStore(id){
		return request({
			url:'/shop/closed?id=' + id,
			method:'put'
		})
	},
	//开业
	openStore(id){
		return request({
			url:'/shop/open?id=' + id,
			method:'put'
		})
	},
	//获取不同社区的客户电话
	getKePhone(scsId){
		return request({
			url:'/csc/service/phone?cscId=' + scsId,
			method:'get'
		})
	}
}
export default adminStore